import * as THREE from 'three';
const model = new THREE.Group();
const geometry = new THREE.SphereGeometry( 5, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const sphere1 = new THREE.Mesh( geometry, material );
sphere1.position.set(0,100,0)
model.add(sphere1)
// 表示速度
const v = new THREE.Vector3(30,0,0);
const g = new THREE.Vector3(0,-9.8,0)
const clock = new THREE.Clock();
function loop (){
    if(sphere1.position.y < 0){
        return
    }
    const spt = clock.getDelta()//每一帧的时间间隔
    const spV = g.clone().multiplyScalar(spt)//速度的变化量
    v.add(spV)//当前速度的值
    const dis = v.clone().multiplyScalar(spt)//位移的变化量
    sphere1.position.add(dis)
   requestAnimationFrame(loop)
}
loop()
export default {model};